#!/bin/tcsh -ef
####
#
#############################################################################
#                                                                           #
# Title: Get SpotList (or refine)                                           #
#                                                                           #
# (C) 2dx.org, GNU Plublic License.                                         #
#                                                                           #
# Created..........: 02/20/2006                                             #
# Last Modification: 02/20/2006                                             #
# Author...........: 2dx.org                                                #
#                                                                           #
#############################################################################
#
# SORTORDER: 45
#
# MANUAL: This script establishes a spotlist, using a simple <B>mmbox</B> evaluation of the FT of the image. This spotlist from the raw image will not be perfect, but may get you to a first approximation of the structure. Later, once unbent versions of the image are available, re-running this script will give better spotlists.
#
#
# PUBLICATION: 2dx - User-friendly image processing for 2D crystals: <A HREF="http://dx.doi.org/10.1016/j.jsb.2006.07.020">J. Struct. Biol. 157 (2007) 64-72</A>
# PUBLICATION: Image processing of 2D crystal images: <A HREF="http://link.springer.com/protocol/10.1007%2F978-1-62703-176-9_10">Methods in Molecular Biology (2012)</A>
#
#
# DISPLAY: RESMIN
# DISPLAY: RESMAX
# DISPLAY: spotlist_RESMAX
# DISPLAY: lattice
# DISPLAY: secondlattice
# DISPLAY: realcell
# DISPLAY: realang
# DISPLAY: ALAT
# DISPLAY: IQMAX1
# DISPLAY: IQMAX
# DISPLAY: spot_source
# DISPLAY: spot_filter
# DISPLAY: spot_exclusion_radius
# DISPLAY: ProtSpotList
# DISPLAY: spotrefine_IHKmax
# DISPLAY: comment
# DISPLAY: TLTAXIS
# DISPLAY: TLTANG
#
#$end_local_vars
#
set bin_2dx = ""
set proc_2dx = ""
#
set SYN_Unbending = ""
set PHASEORI_done = ""
#
set imagename = ""
set nonmaskimagename = ""
set imagenumber = ""
set realcell = ""
set lattice = ""
set secondlattice = ""
set TLTAXIS = ""
set TLTANG = ""
set TLTAXA = ""
set TAXA = ""
set TANGL = ""
set imagesidelength = ""
set magnification = ""
set stepdigitizer = ""
set tempkeep = ""
set revhk = ""
set realang = ""
set RESMIN = ""
set RESMAX = ""
set spotlist_RESMAX = ""
set ALAT = "" 
set lattice = ""
set IQMAX = ""
set spot_source = ""
set spot_filter = ""
set spot_exclusion_radius = ""
set ProtSpotList = ""
set spotrefine_IHKmax = ""
set ctfcor_imode = ""
#
#$end_vars
#
set scriptname = 2dx_getspots
#
\rm -f LOGS/${scriptname}.results
#
echo "<<@evaluate>>"
#
set IS_2DX = yes
source ${proc_2dx}/initialize
#
#
if ( x${TLTAXIS} == "x-" || x${TLTAXIS} == "x--" ) then
  set TLTAXIS = "0.0"
endif
if ( x${TLTANG} == "x-" || x${TLTANG} == "x--" ) then
  set TLTANG = "0.0"
endif
if ( x${TLTAXA} == "x-" || x${TLTAXA} == "x--" ) then
  set TLTAXA = "0.0"
endif
if ( x${TAXA} == "x-" || x${TAXA} == "x--" ) then
  set TAXA = "0.0"
endif
if ( x${TANGL} == "x-" || x${TANGL} == "x--" ) then
  set TANGL = "0.0"
endif
#
#
#
#
##########################################################################
##########################################################################
##########################################################################
source ${proc_2dx}/2dx_getspots_sub.com
##########################################################################
##########################################################################
##########################################################################
#
#
#
#
#
##########################################################################
${proc_2dx}/linblock "${scriptname} - normal end."
##########################################################################
#
echo "<<@progress: 100>>"
#
